CREATE TABLE [dbo].[tb_Parametros]
(
[idParametro] [int] NOT NULL IDENTITY(1, 1),
[Categoria] [int] NOT NULL,
[Parametro] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Descripcion] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Alcance] [int] NOT NULL,
[Tipo1] [int] NOT NULL,
[Valor1] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Tipo2] [int] NULL,
[Valor2] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[EsRelacion] [varchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[tb_Parametros] ADD CONSTRAINT [PK_tb_Parametros] PRIMARY KEY CLUSTERED  ([idParametro]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[tb_Parametros] WITH NOCHECK ADD CONSTRAINT [FK_tb_Parametros_tb_AlcanceDeParametros] FOREIGN KEY ([Alcance]) REFERENCES [dbo].[tb_AlcanceDeParametros] ([idAlcanceParametros])
GO
ALTER TABLE [dbo].[tb_Parametros] WITH NOCHECK ADD CONSTRAINT [FK_tb_Parametros_tb_CategoriaDeParametros] FOREIGN KEY ([Categoria]) REFERENCES [dbo].[tb_CategoriaDeParametros] ([idCategoriaParametros])
GO
ALTER TABLE [dbo].[tb_Parametros] WITH NOCHECK ADD CONSTRAINT [FK_tb_Parametros_tb_TiposParametros] FOREIGN KEY ([Tipo1]) REFERENCES [dbo].[tb_TiposParametros] ([idTipoParametro]) NOT FOR REPLICATION
GO
ALTER TABLE [dbo].[tb_Parametros] WITH NOCHECK ADD CONSTRAINT [FK_tb_Parametros_tb_TiposParametros1] FOREIGN KEY ([Tipo2]) REFERENCES [dbo].[tb_TiposParametros] ([idTipoParametro]) NOT FOR REPLICATION
GO
ALTER TABLE [dbo].[tb_Parametros] NOCHECK CONSTRAINT [FK_tb_Parametros_tb_CategoriaDeParametros]
GO
ALTER TABLE [dbo].[tb_Parametros] NOCHECK CONSTRAINT [FK_tb_Parametros_tb_TiposParametros]
GO
ALTER TABLE [dbo].[tb_Parametros] NOCHECK CONSTRAINT [FK_tb_Parametros_tb_TiposParametros1]
GO
